﻿using System;

namespace Silverlight.Media.Encoder.Sinks
{
    public enum SampleType
    {
        Video = 1,
        Audio = 2
    }

    public class OnSampleArgs : EventArgs
    {
        private readonly TimeSpan m_sampleTime;
        private readonly TimeSpan m_frameDuration;
        private readonly byte[] m_sampleData;

        private SampleType m_sampleDataType;

        public OnSampleArgs(long sampleTimeInHundredNanoseconds, long frameDurationInHundredNanoseconds, byte[] sampleData, SampleType sampleDataType)
        {
            m_sampleDataType = sampleDataType;
            m_sampleTime = TimeSpan.FromTicks(sampleTimeInHundredNanoseconds);
            m_frameDuration = TimeSpan.FromTicks(frameDurationInHundredNanoseconds);
            m_sampleData = sampleData;
        }

        public byte[] SampleData
        {
            get { return m_sampleData; }
        }

        public TimeSpan FrameDuration
        {
            get { return m_frameDuration; }
        }

        public TimeSpan SampleTime
        {
            get { return m_sampleTime; }
        }

        public SampleType SampleDataType
        {
            get { return m_sampleDataType; }
            set { m_sampleDataType = value; }
        }
    }
}
